package com.example.bean.base;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author wangfeng
 * @Description
 * @Date 2021/9/27
 **/
@Data
public abstract class BaseEntity implements Serializable {
	private static final long serialVersionUID = 497413566278863404L;

	@TableId(type = IdType.AUTO)
	private Long id;

	@TableField(value = "create_time", fill = FieldFill.INSERT)
	private Date createTime;

	@TableField(value = "modify_time", fill = FieldFill.INSERT_UPDATE,exist = false)
	private Date modifyTime;

	@TableField(value = "dr", fill = FieldFill.INSERT)
	@TableLogic(value = "0", delval = "1")
	private Integer dr;

	@Version
	@TableField(exist = false)
	private Integer ver;

	public String getCreateTimeStr() {
		if(getCreateTime() != null) {
			return "";
		}
		return "";
	}

	public String getModifyTimeStr() {
		if(getModifyTime() != null) {
			return "";
		}
		return "";
	}
}